using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ModelTools._ModelOnly
{
    /// <summary>
    /// <para>If Field Exists</para>
    /// <para>Evaluates if the input data has the specified fields.</para>
    /// <para>评估输入数据是否具有指定的字段。</para>
    /// </summary>    
    [DisplayName("If Field Exists")]
    public class FieldExistsIfThenElse : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FieldExistsIfThenElse()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>Input table that will be evaluated for the existence of the specified fields.</para>
        /// <para>将评估是否存在指定字段的输入表。</para>
        /// </param>
        /// <param name="_field_test_type">
        /// <para>Field Test</para>
        /// <para><xdoc>
        ///   <para>The criteria to test the specified list of fields against.</para>
        ///   <bulletList>
        ///     <bullet_item>Must have all fields—All fields must exists.</bullet_item><para/>
        ///     <bullet_item>Must have at least one field—Must have at least one of the specified fields.</bullet_item><para/>
        ///     <bullet_item>Must not have all fields—Must not have any of the specified fields.</bullet_item><para/>
        ///     <bullet_item>Must not have at least one field—Must not have at least one of the specified fields.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于测试指定字段列表的条件。</para>
        ///   <bulletList>
        ///     <bullet_item>必须包含所有字段 - 所有字段必须存在。</bullet_item><para/>
        ///     <bullet_item>必须至少有一个字段 - 必须至少有一个指定字段。</bullet_item><para/>
        ///     <bullet_item>不得包含所有字段 - 不得包含任何指定字段。</bullet_item><para/>
        ///     <bullet_item>不得至少有一个字段 - 不得至少有一个指定字段。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_field">
        /// <para>Fields</para>
        /// <para>Field names to check for in the input table.</para>
        /// <para>要在输入表中检查的字段名称。</para>
        /// </param>
        public FieldExistsIfThenElse(object _in_table, _field_test_type_value _field_test_type, List<object> _field)
        {
            this._in_table = _in_table;
            this._field_test_type = _field_test_type;
            this._field = _field;
        }
        public override string ToolboxName => "Model Tools";

        public override string ToolName => "If Field Exists";

        public override string CallName => "mb.FieldExistsIfThenElse";

        public override List<string> AcceptEnvironments => [];

        public override object[] ParameterInfo => [_in_table, _field_test_type.GetGPValue(), _field, _true, _false];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>Input table that will be evaluated for the existence of the specified fields.</para>
        /// <para>将评估是否存在指定字段的输入表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Field Test</para>
        /// <para><xdoc>
        ///   <para>The criteria to test the specified list of fields against.</para>
        ///   <bulletList>
        ///     <bullet_item>Must have all fields—All fields must exists.</bullet_item><para/>
        ///     <bullet_item>Must have at least one field—Must have at least one of the specified fields.</bullet_item><para/>
        ///     <bullet_item>Must not have all fields—Must not have any of the specified fields.</bullet_item><para/>
        ///     <bullet_item>Must not have at least one field—Must not have at least one of the specified fields.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于测试指定字段列表的条件。</para>
        ///   <bulletList>
        ///     <bullet_item>必须包含所有字段 - 所有字段必须存在。</bullet_item><para/>
        ///     <bullet_item>必须至少有一个字段 - 必须至少有一个指定字段。</bullet_item><para/>
        ///     <bullet_item>不得包含所有字段 - 不得包含任何指定字段。</bullet_item><para/>
        ///     <bullet_item>不得至少有一个字段 - 不得至少有一个指定字段。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field Test")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _field_test_type_value _field_test_type { get; set; }

        public enum _field_test_type_value
        {
            /// <summary>
            /// <para>Must have all fields</para>
            /// <para>Must have all fields—All fields must exists.</para>
            /// <para>必须包含所有字段 - 所有字段必须存在。</para>
            /// </summary>
            [Description("Must have all fields")]
            [GPEnumValue("MUST_HAVE_ALL_FIELDS")]
            _MUST_HAVE_ALL_FIELDS,

            /// <summary>
            /// <para>Must have at least one field</para>
            /// <para>Must have at least one field—Must have at least one of the specified fields.</para>
            /// <para>必须至少有一个字段 - 必须至少有一个指定字段。</para>
            /// </summary>
            [Description("Must have at least one field")]
            [GPEnumValue("MUST_HAVE_AT_LEAST_ONE_FIELD")]
            _MUST_HAVE_AT_LEAST_ONE_FIELD,

            /// <summary>
            /// <para>Must not have all fields</para>
            /// <para>Must not have all fields—Must not have any of the specified fields.</para>
            /// <para>不得包含所有字段 - 不得包含任何指定字段。</para>
            /// </summary>
            [Description("Must not have all fields")]
            [GPEnumValue("MUST_NOT_HAVE_ALL_FIELDS")]
            _MUST_NOT_HAVE_ALL_FIELDS,

            /// <summary>
            /// <para>Must not have at least one field</para>
            /// <para>Must not have at least one field—Must not have at least one of the specified fields.</para>
            /// <para>不得至少有一个字段 - 不得至少有一个指定字段。</para>
            /// </summary>
            [Description("Must not have at least one field")]
            [GPEnumValue("MUST_NOT_HAVE_AT_LEAST_ONE_FIELD")]
            _MUST_NOT_HAVE_AT_LEAST_ONE_FIELD,

        }

        /// <summary>
        /// <para>Fields</para>
        /// <para>Field names to check for in the input table.</para>
        /// <para>要在输入表中检查的字段名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Fields")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _field { get; set; }


        /// <summary>
        /// <para>True</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("True")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _true { get; set; }


        /// <summary>
        /// <para>False</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("False")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _false { get; set; }


        public FieldExistsIfThenElse SetEnv()
        {
            base.SetEnv();
            return this;
        }

    }

}